home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3dm / audiocddat / CDaddcallback.z / CDaddcallback
Encoding:
Text File  |  2002-10-03  |  8.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4. CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm))))                                          CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CDaddcallback - set a callback for the CD audio data parser
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ccccddddaaaauuuuddddiiiioooo....hhhh>>>>
  14.  
  15.      vvvvooooiiiidddd CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((CCCCDDDDPPPPAAAARRRRSSSSEEEERRRR**** ccccddddpppp,,,, CCCCDDDDDDDDAAAATTTTAAAATTTTYYYYPPPPEEEESSSS ttttyyyyppppeeee,,,,
  16.                     CCCCDDDDCCCCAAAALLLLLLLLBBBBAAAACCCCKKKKFFFFUUUUNNNNCCCC ffffuuuunnnncccc,,,, vvvvooooiiiidddd**** aaaarrrrgggg))))
  17.  
  18. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  19.      _c_d_p    A pointer to the target CCCCDDDDPPPPAAAARRRRSSSSEEEERRRR....
  20.  
  21.      _t_y_p_e   The type of callback being set.  CDDATATYPES is an enumerated type
  22.             defined in _c_d_a_u_d_i_o._h containing the following values:  _c_d__a_u_d_i_o,
  23.             _c_d__p_n_u_m, _c_d__i_n_d_e_x, _c_d__p_t_i_m_e, _c_d__a_t_i_m_e, _c_d__c_a_t_a_l_o_g, _c_d__i_d_e_n_t,
  24.             _c_d__c_o_n_t_r_o_l.
  25.  
  26.      _f_u_n_c   A pointer to the function to be called.
  27.  
  28.      _a_r_g    A user supplied argument that is passed to the callback function.
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm)))) adds a callback for the specified parser.  The parser
  32.      has callbacks for eight different types of data in the digital audio data
  33.      stream corresponding to the enumerated types listed above.  When data of
  34.      a particular type changes in the data stream from the disc, the parser
  35.      invokes the corresponding callback passing it a pointer to the data.  The
  36.      _c_d__a_u_d_i_o callback is an exception to this.  It is called for every
  37.      recorded frame regardless of whether the data changed.
  38.  
  39.      The callback is called as follows
  40.  
  41.               func(void* arg, CDDATATYPES type, void* data);
  42.  
  43.  
  44.      _a_r_g is the user supplied argument provided as the fourth parameter to
  45.      CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm)))).... _t_y_p_e is the particular type of callback.  It is
  46.      passed so that a single function could be used for all eight callbacks.
  47.      _d_a_t_a is the data returned for this _t_y_p_e of callback.  The argument is
  48.      cast to void*.  Each type of callback returns a different kind of data.
  49.      An explanation of the callback types and data structures passed to them
  50.      is given below.  See _c_d_f_r_a_m_e(4) for a detailed description of each type
  51.      of data in the digital audio data stream.
  52.  
  53.    ccccdddd____aaaauuuuddddiiiioooo
  54.      This is the audio data.  The _d_a_t_a argument in this case is really a
  55.      sssshhhhoooorrrrtttt**** pointing at an array containing the byte-swapped and, if
  56.      necessary, de-emphasized audio data ready to hand to AAAALLLLwwwwrrrriiiitttteeeessssaaaammmmppppssss((((3333ddddmmmm))))....
  57.      If you use this callback you will want to change the handling of floating
  58.      point underflow exceptions to achieve acceptable performance.  Put the
  59.      following lines of code in your program:
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm))))                                          CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.               #include <sigfpe.h>
  75.  
  76.               sigfpe_[_UNDERFL].repls = _ZERO;
  77.               handle_sigfpes(_ON, _EN_UNDERFL, NULL, _ABORT_ON_ERROR, NULL);
  78.  
  79.  
  80.      See _C_D_i_n_t_r_o(_3_d_m) for a complete explanation.
  81.  
  82.    ccccdddd____ppppnnnnuuuummmm
  83.      This is the number of the current program (aka track).  The data type in
  84.      this case is a pointer to a ssssttttrrrruuuucccctttt ccccddddpppprrrrooooggggnnnnuuuummmm defined in _c_d_a_u_d_i_o._h as
  85.      follows:
  86.  
  87.               typedef struct cdprognum {
  88.                   int value;                  /* Program converted to integer */
  89.                   struct cdpackedbcd bcd;     /* Program in BCD digits */
  90.               } CDPROGNUM;
  91.  
  92.  
  93.      Program number AA (program number not currently valid) is represented in
  94.      the converted _v_a_l_u_e by 0xaaa.  Program number BB (lead-in) is represented
  95.      by 0xbbb and program number EE (lead-out) is represented by 0xeee.
  96.  
  97.    ccccdddd____iiiinnnnddddeeeexxxx
  98.      This is the index number of the current subdivision within the program.
  99.      The data type in this case is a pointer to a ssssttttrrrruuuucccctttt ccccddddpppprrrrooooggggnnnnuuuummmm as
  100.      described above.
  101.  
  102.    ccccdddd____ppppttttiiiimmmmeeee
  103.      This is the time into the current program.  The data type is a pointer to
  104.      a ssssttttrrrruuuucccctttt ccccddddttttiiiimmmmeeeeccccooooddddeeee defined in _c_d_a_u_d_i_o._h as follows:
  105.  
  106.               struct cdtimecode {
  107.                   unchar mhi:4, mlo:4;
  108.                   unchar shi:4, slo:4;
  109.                   unchar fhi:4, flo:4;
  110.               } ptime;
  111.  
  112.  
  113.    ccccdddd____aaaattttiiiimmmmeeee
  114.      This is the time since the start of the disc (absolute time).  The data
  115.      type is a pointer to a ssssttttrrrruuuucccctttt ccccddddttttiiiimmmmeeeeccccooooddddeeee as described above.
  116.  
  117.    ccccdddd____ccccaaaattttaaaalllloooogggg
  118.      This is the catalog number of the CD.  The data type is a cccchhhhaaaarrrr**** pointing
  119.      to an array of 13 bytes.  Each byte contains 1 BCD digit in its least
  120.      significant nibble.
  121.  
  122.    ccccdddd____iiiiddddeeeennnntttt
  123.      This is the ISRC identification number of the recording.  The data type
  124.      is a pointer to a ssssttttrrrruuuucccctttt ccccddddiiiiddddeeeennnntttt defined in _c_d_a_u_d_i_o._h as follows:
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm))))                                          CCCCDDDDaaaaddddddddccccaaaallllllllbbbbaaaacccckkkk((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140.               struct cdident {
  141.                   unchar country[2];
  142.                   unchar owner[3];
  143.                   unchar year[2];
  144.                   unchar serial[5];
  145.               } ident;
  146.  
  147.  
  148.      _c_o_u_n_t_r_y and _o_w_n_e_r are encoded in the six-bit code converted by
  149.      CCCCDDDDssssbbbbttttooooaaaa((((3333ddddmmmm)))).... _y_e_a_r and _s_e_r_i_a_l _a_r_e _B_C_D _d_i_g_i_t_s.
  150.  
  151.    ccccdddd____ccccoooonnnnttttrrrroooollll
  152.      This is for the control bits from the CD subcode data.  The data type is
  153.      uuuunnnncccchhhhaaaarrrr**** pointing at a single byte.  The bits in this byte include copy
  154.      protect and preemphasis on or off.
  155.  
  156. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  157.      Cdintro(3dm), CDseekblock(3dm), CDseektrack(3dm), CDclose(3dm),
  158.      CDcreateparser(3dm), CDopen(3dm), CDparseframe(3dm), CDreadda(3dm),
  159.      CDseek(3dm), CDremovecallback(3dm), CDresetparser(3dm), cdframe(4),
  160.      sigfpe(3C)
  161.  
  162. AAAAUUUUTTTTHHHHOOOORRRR
  163.      Roger Chickering, Mark Callow
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.